<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul>
    <li class="itme">1</li>
    <li class="itme">1</li>
    <li class="itme">1</li>
    <li class="itme">1</li>
    <li class="itme">1</li>
    <li class="itme">1</li>
  </ul>
  <script>
    var data = document.querySelectorAll('.itme')
    console.log(data)
    var speciallApp = function (nums) {
      nums.sort((a, b) => b - a)
      let res = -1
      for (let i = 0; i < nums.length; i++) {
        if (nums[i] >= i + 1 && (nums[i + 1] || -1) < i + 1) res = i + 1
      }
      return res
    }
    console.log(speciallApp(nums = [3, 5]))
  </script>
</body>

</html>